package com.mszl.blog.controller;

import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import com.mszl.blog.service.SysUserService;
import com.mszl.blog.vo.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("users")
public class SysUserController {

    @Autowired
    SysUserService sysUserService;
    @GetMapping("/currentUser")
    public Result currentUser(@RequestHeader("Authorization") String token){

        return Result.success(sysUserService.getUserInfoByToken(token));
    }
}
